<template>
  <commonCard :titleArr="titleArr" :currnetId="currnetId" @setId="setId">
    <case-assembly v-if="currnetId == 1"></case-assembly>
    <prescription v-else-if="currnetId == 2"></prescription>
  </commonCard>
</template>
<script>
import commonCard from "@/components/common/commonCard.vue";
import caseAssembly from "@/components/completed/case.vue";
import prescription from "@/components/completed/prescription.vue";
export default {
  components: {
    caseAssembly,
    prescription,
    commonCard,
  },
  data() {
    return {
      currnetId: 1,
      titleArr: [
        {
          id: 1,
          name: "病例",
        },
        {
          id: 2,
          name: "处方",
        },
      ],
    };
  },
  methods: {
    setId(i) {
      this.currnetId = i;
    },
  },
};
</script>
